# 检查路径是否存在  
if os.path.exists(CORPUS_PATH) and os.path.isfile(CORPUS_PATH):  
    print(f"{CORPUS_PATH} exists and is a file.")  
else:  
    print(f"{CORPUS_PATH} does not exist or is not a file.")  
  
if os.path.exists(RAW_PATH) and os.path.isfile(RAW_PATH):  
    print(f"{RAW_PATH} exists and is a file.")  
else:  
    print(f"{RAW_PATH} does not exist or is not a file.")  
  
# 尝试打开文件读取  
try:  
    with open(CORPUS_PATH, 'r', encoding='utf-8') as f:  
        print(f"Successfully opened {CORPUS_PATH} for reading.")  
except Exception as e:  
    print(f"Error opening {CORPUS_PATH}: {e}")  
  
try:  
    with open(RAW_PATH, 'r', encoding='utf-8') as f:  
        print(f"Successfully opened {RAW_PATH} for reading.")  
except Exception as e:  
    print(f"Error opening {RAW_PATH}: {e}")

# 这两个路径有极大的不同
current_working_dir = os.getcwd() 
script_dir = os.path.dirname(script_path)